package com.example.service.impl;

import com.example.entity.ColonyHouse;
import com.example.entity.Page;
import com.example.mapper.ColonyHouseMapper;
import com.example.service.ColonyHouseService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class ColonyHouseServiceImpl implements ColonyHouseService {

    @Autowired
    private ColonyHouseMapper colonyHouseMapper;

    // 分页查询圈舍的业务方法
    @Override
    public List<ColonyHouse> findAllColonyHouse(Page page, ColonyHouse colonyHouse) {
        return colonyHouseMapper.findAllColonyHouse(page, colonyHouse);
    }

    //查询圈舍总条数的业务方法
    @Override
    public List<ColonyHouse> findAll(ColonyHouse colonyHouse) {
        return colonyHouseMapper.findAll(colonyHouse);
    }

    // 禁用圈舍的业务方法
    @Override
    public int delColonyHouse(ColonyHouse colonyHouse) {
        return colonyHouseMapper.delColonyHouse(colonyHouse);
    }

    // 修改圈舍信息的业务方法
    @Override
    public int updateColonyHouse(ColonyHouse colonyHouse) {
        return colonyHouseMapper.updateColonyHouse(colonyHouse);
    }

    // 删除圈舍的业务方法
    @Override
    public int deleteColonyHouse(ColonyHouse colonyHouse) {
        return colonyHouseMapper.deleteColonyHouse(colonyHouse);
    }

    // 新增圈舍的业务方法
    @Override
    public int addColonyHouse(ColonyHouse colonyHouse) {
        return colonyHouseMapper.addColonyHouse(colonyHouse);
    }

    // 分页模糊查询圈舍的业务方法
    @Override
    public List<ColonyHouse> searchColonyHouse(Page page, ColonyHouse colonyHouse) {
        return colonyHouseMapper.searchColonyHouse(page, colonyHouse);
    }

    // 分页模糊查询总条数的业务方法
    @Override
    public List<ColonyHouse> searchAllColonyHouse(ColonyHouse colonyHouse) {
        return colonyHouseMapper.searchAllColonyHouse(colonyHouse);
    }
}
